home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 April: Mac OS SDK / Dev.CD Apr 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / QD3DErrors.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-12  |  11.4 KB  |  336 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QD3DErrors.h
  3.  
  4.      Contains:    Error API and error codes                                        
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.1
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __QD3DERRORS__
  19. #define __QD3DERRORS__
  20.  
  21. #ifndef __QD3D__
  22. #include <QD3D.h>
  23. #endif
  24.  
  25. #if TARGET_OS_MAC
  26. #ifndef __MACTYPES__
  27. #include <MacTypes.h>
  28. #endif
  29. #endif  /* TARGET_OS_MAC */
  30.  
  31.  
  32.  
  33. #if PRAGMA_ONCE
  34. #pragma once
  35. #endif
  36.  
  37. #ifdef __cplusplus
  38. extern "C" {
  39. #endif
  40.  
  41. #if PRAGMA_IMPORT
  42. #pragma import on
  43. #endif
  44.  
  45. #if PRAGMA_STRUCT_ALIGN
  46.     #pragma options align=power
  47. #elif PRAGMA_STRUCT_PACKPUSH
  48.     #pragma pack(push, 2)
  49. #elif PRAGMA_STRUCT_PACK
  50.     #pragma pack(2)
  51. #endif
  52.  
  53. #if PRAGMA_ENUM_ALWAYSINT
  54.     #pragma enumsalwaysint on
  55. #elif PRAGMA_ENUM_OPTIONS
  56.     #pragma option enum=int
  57. #elif PRAGMA_ENUM_PACK
  58.     #if __option(pack_enums)
  59.         #define PRAGMA_ENUM_PACK__QD3DERRORS__
  60.     #endif
  61.     #pragma options(!pack_enums)
  62. #endif
  63.  
  64. /******************************************************************************
  65.  **                                                                             **
  66.  **                            Error Types and Codes                             **
  67.  **                                                                             **
  68.  *****************************************************************************/
  69.  
  70. enum TQ3Error {
  71.     kQ3ErrorNone                = 0,                            /* Fatal Errors */
  72.     kQ3ErrorInternalError        = -28500,
  73.     kQ3ErrorNoRecovery            = -28499,
  74.     kQ3ErrorLastFatalError        = -28498,                        /* System Errors */
  75.     kQ3ErrorNotInitialized        = -28490,
  76.     kQ3ErrorAlreadyInitialized    = -28489,
  77.     kQ3ErrorUnimplemented        = -28488,
  78.     kQ3ErrorRegistrationFailed    = -28487,                        /* OS Errors */
  79.     kQ3ErrorUnixError            = -28486,
  80.     kQ3ErrorMacintoshError        = -28485,
  81.     kQ3ErrorX11Error            = -28484,                        /* Memory Errors */
  82.     kQ3ErrorMemoryLeak            = -28483,
  83.     kQ3ErrorOutOfMemory            = -28482,                        /* Parameter errors */
  84.     kQ3ErrorNULLParameter        = -28481,
  85.     kQ3ErrorParameterOutOfRange    = -28480,
  86.     kQ3ErrorInvalidParameter    = -28479,
  87.     kQ3ErrorInvalidData            = -28478,
  88.     kQ3ErrorAcceleratorAlreadySet = -28477,
  89.     kQ3ErrorVector3DNotUnitLength = -28476,
  90.     kQ3ErrorVector3DZeroLength    = -28475,                        /* Object Errors */
  91.     kQ3ErrorInvalidObject        = -28474,
  92.     kQ3ErrorInvalidObjectClass    = -28473,
  93.     kQ3ErrorInvalidObjectType    = -28472,
  94.     kQ3ErrorInvalidObjectName    = -28471,
  95.     kQ3ErrorObjectClassInUse    = -28470,
  96.     kQ3ErrorAccessRestricted    = -28469,
  97.     kQ3ErrorMetaHandlerRequired    = -28468,
  98.     kQ3ErrorNeedRequiredMethods    = -28467,
  99.     kQ3ErrorNoSubClassType        = -28466,
  100.     kQ3ErrorUnknownElementType    = -28465,
  101.     kQ3ErrorNotSupported        = -28464,                        /* Extension Errors */
  102.     kQ3ErrorNoExtensionsFolder    = -28463,
  103.     kQ3ErrorExtensionError        = -28462,
  104.     kQ3ErrorPrivateExtensionError = -28461,                        /* Geometry Errors */
  105.     kQ3ErrorDegenerateGeometry    = -28460,
  106.     kQ3ErrorGeometryInsufficientNumberOfPoints = -28459,        /* IO Errors */
  107.     kQ3ErrorNoStorageSetForFile    = -28458,
  108.     kQ3ErrorEndOfFile            = -28457,
  109.     kQ3ErrorFileCancelled        = -28456,
  110.     kQ3ErrorInvalidMetafile        = -28455,
  111.     kQ3ErrorInvalidMetafilePrimitive = -28454,
  112.     kQ3ErrorInvalidMetafileLabel = -28453,
  113.     kQ3ErrorInvalidMetafileObject = -28452,
  114.     kQ3ErrorInvalidMetafileSubObject = -28451,
  115.     kQ3ErrorInvalidSubObjectForObject = -28450,
  116.     kQ3ErrorUnresolvableReference = -28449,
  117.     kQ3ErrorUnknownObject        = -28448,
  118.     kQ3ErrorStorageInUse        = -28447,
  119.     kQ3ErrorStorageAlreadyOpen    = -28446,
  120.     kQ3ErrorStorageNotOpen        = -28445,
  121.     kQ3ErrorStorageIsOpen        = -28444,
  122.     kQ3ErrorFileAlreadyOpen        = -28443,
  123.     kQ3ErrorFileNotOpen            = -28442,
  124.     kQ3ErrorFileIsOpen            = -28441,
  125.     kQ3ErrorBeginWriteAlreadyCalled = -28440,
  126.     kQ3ErrorBeginWriteNotCalled    = -28439,
  127.     kQ3ErrorEndWriteNotCalled    = -28438,
  128.     kQ3ErrorReadStateInactive    = -28437,
  129.     kQ3ErrorStateUnavailable    = -28436,
  130.     kQ3ErrorWriteStateInactive    = -28435,
  131.     kQ3ErrorSizeNotLongAligned    = -28434,
  132.     kQ3ErrorFileModeRestriction    = -28433,
  133.     kQ3ErrorInvalidHexString    = -28432,
  134.     kQ3ErrorWroteMoreThanSize    = -28431,
  135.     kQ3ErrorWroteLessThanSize    = -28430,
  136.     kQ3ErrorReadLessThanSize    = -28429,
  137.     kQ3ErrorReadMoreThanSize    = -28428,
  138.     kQ3ErrorNoBeginGroup        = -28427,
  139.     kQ3ErrorSizeMismatch        = -28426,
  140.     kQ3ErrorStringExceedsMaximumLength = -28425,
  141.     kQ3ErrorValueExceedsMaximumSize = -28424,
  142.     kQ3ErrorNonUniqueLabel        = -28423,
  143.     kQ3ErrorEndOfContainer        = -28422,
  144.     kQ3ErrorUnmatchedEndGroup    = -28421,
  145.     kQ3ErrorFileVersionExists    = -28420,                        /* View errors */
  146.     kQ3ErrorViewNotStarted        = -28419,
  147.     kQ3ErrorViewIsStarted        = -28418,
  148.     kQ3ErrorRendererNotSet        = -28417,
  149.     kQ3ErrorRenderingIsActive    = -28416,
  150.     kQ3ErrorImmediateModeUnderflow = -28415,
  151.     kQ3ErrorDisplayNotSet        = -28414,
  152.     kQ3ErrorCameraNotSet        = -28413,
  153.     kQ3ErrorDrawContextNotSet    = -28412,
  154.     kQ3ErrorNonInvertibleMatrix    = -28411,
  155.     kQ3ErrorRenderingNotStarted    = -28410,
  156.     kQ3ErrorPickingNotStarted    = -28409,
  157.     kQ3ErrorBoundsNotStarted    = -28408,
  158.     kQ3ErrorDataNotAvailable    = -28407,
  159.     kQ3ErrorNothingToPop        = -28406,                        /* Renderer Errors */
  160.     kQ3ErrorUnknownStudioType    = -28405,
  161.     kQ3ErrorAlreadyRendering    = -28404,
  162.     kQ3ErrorStartGroupRange        = -28403,
  163.     kQ3ErrorUnsupportedGeometryType = -28402,
  164.     kQ3ErrorInvalidGeometryType    = -28401,
  165.     kQ3ErrorUnsupportedFunctionality = -28400,                    /* Group Errors */
  166.     kQ3ErrorInvalidPositionForGroup = -28399,
  167.     kQ3ErrorInvalidObjectForGroup = -28398,
  168.     kQ3ErrorInvalidObjectForPosition = -28397,                    /* Transform Errors */
  169.     kQ3ErrorScaleOfZero            = -28396,                        /* String Errors */
  170.     kQ3ErrorBadStringType        = -28395,                        /* Attribute Errors */
  171.     kQ3ErrorAttributeNotContained = -28394,
  172.     kQ3ErrorAttributeInvalidType = -28393,                        /* Camera Errors */
  173.     kQ3ErrorInvalidCameraValues    = -28392,                        /* DrawContext Errors */
  174.     kQ3ErrorBadDrawContextType    = -28391,
  175.     kQ3ErrorBadDrawContextFlag    = -28390,
  176.     kQ3ErrorBadDrawContext        = -28389,
  177.     kQ3ErrorUnsupportedPixelDepth = -28388,                        /* Controller Errors */
  178.     kQ3ErrorController            = -28387,                        /* Tracker Errors */
  179.     kQ3ErrorTracker                = -28386,                        /* Another OS Error */
  180.     kQ3ErrorWin32Error            = -28385,                        /* Object Errors */
  181.     kQ3ErrorTypeAlreadyExistsAndHasSubclasses = -28384,
  182.     kQ3ErrorTypeAlreadyExistsAndOtherClassesDependOnIt = -28383,
  183.     kQ3ErrorTypeAlreadyExistsAndHasObjectInstances = -28382,    /* submit loop errors: if you ever get one of these check the previous*/
  184.                                                                 /* error posted, it may be kQ3ErrorOutOfMemory.  If so you *may* be able*/
  185.                                                                 /* to recover by freeing up some memory and trying again*/
  186.     kQ3ErrorPickingLoopFailed    = -28381,
  187.     kQ3ErrorRenderingLoopFailed    = -28380,
  188.     kQ3ErrorWritingLoopFailed    = -28379,
  189.     kQ3ErrorBoundingLoopFailed    = -28378
  190. };
  191. typedef enum TQ3Error TQ3Error;
  192.  
  193.  
  194. enum TQ3Warning {
  195.     kQ3WarningNone                = 0,                            /* General System */
  196.     kQ3WarningInternalException    = -28300,                        /* Object Warnings */
  197.     kQ3WarningNoObjectSupportForDuplicateMethod = -28299,
  198.     kQ3WarningNoObjectSupportForDrawMethod = -28298,
  199.     kQ3WarningNoObjectSupportForWriteMethod = -28297,
  200.     kQ3WarningNoObjectSupportForReadMethod = -28296,
  201.     kQ3WarningUnknownElementType = -28295,
  202.     kQ3WarningTypeAndMethodAlreadyDefined = -28294,
  203.     kQ3WarningTypeIsOutOfRange    = -28293,
  204.     kQ3WarningTypeHasNotBeenRegistered = -28292,                /* Parameter Warnings */
  205.     kQ3WarningVector3DNotUnitLength = -28291,                    /* IO Warnings */
  206.     kQ3WarningInvalidSubObjectForObject = -28290,
  207.     kQ3WarningInvalidHexString    = -28289,
  208.     kQ3WarningUnknownObject        = -28288,
  209.     kQ3WarningInvalidMetafileObject = -28287,
  210.     kQ3WarningUnmatchedBeginGroup = -28286,
  211.     kQ3WarningUnmatchedEndGroup    = -28285,
  212.     kQ3WarningInvalidTableOfContents = -28284,
  213.     kQ3WarningUnresolvableReference = -28283,
  214.     kQ3WarningNoAttachMethod    = -28282,
  215.     kQ3WarningInconsistentData    = -28281,
  216.     kQ3WarningReadLessThanSize    = -28280,
  217.     kQ3WarningFilePointerResolutionFailed = -28279,
  218.     kQ3WarningFilePointerRedefined = -28278,
  219.     kQ3WarningStringExceedsMaximumLength = -28277,                /* Memory Warnings */
  220.     kQ3WarningLowMemory            = -28276,
  221.     kQ3WarningPossibleMemoryLeak = -28275,                        /* View Warnings */
  222.     kQ3WarningViewTraversalInProgress = -28274,
  223.     kQ3WarningNonInvertibleMatrix = -28273,                        /* Quaternion Warning */
  224.     kQ3WarningQuaternionEntriesAreZero = -28272,                /* Renderer Warning */
  225.     kQ3WarningFunctionalityNotSupported = -28271,                /* DrawContext Warning */
  226.     kQ3WarningInvalidPaneDimensions = -28270,                    /* Pick Warning */
  227.     kQ3WarningPickParamOutside    = -28269,                        /* Scale Warnings */
  228.     kQ3WarningScaleEntriesAllZero = -28268,
  229.     kQ3WarningScaleContainsNegativeEntries = -28267,            /* Generic Warnings */
  230.     kQ3WarningParameterOutOfRange = -28266,                        /* Extension Warnings */
  231.     kQ3WarningExtensionNotLoading = -28265,                        /* Object Warnings */
  232.     kQ3WarningTypeAlreadyRegistered = -28264,
  233.     kQ3WarningTypeSameVersionAlreadyRegistered = -28263,
  234.     kQ3WarningTypeNewerVersionAlreadyRegistered = -28262,        /* Invalid Group Object */
  235.     kQ3WarningInvalidObjectInGroupMetafile = -28261
  236. };
  237. typedef enum TQ3Warning TQ3Warning;
  238.  
  239.  
  240.  
  241. enum TQ3Notice {
  242.     kQ3NoticeNone                = 0,
  243.     kQ3NoticeDataAlreadyEmpty    = -28100,
  244.     kQ3NoticeMethodNotSupported    = -28099,
  245.     kQ3NoticeObjectAlreadySet    = -28098,
  246.     kQ3NoticeParameterOutOfRange = -28097,
  247.     kQ3NoticeFileAliasWasChanged = -28096,
  248.     kQ3NoticeMeshVertexHasNoComponent = -28095,
  249.     kQ3NoticeMeshInvalidVertexFacePair = -28094,
  250.     kQ3NoticeMeshEdgeVertexDoNotCorrespond = -28093,
  251.     kQ3NoticeMeshEdgeIsNotBoundary = -28092,
  252.     kQ3NoticeDrawContextNotSetUsingInternalDefaults = -28091,
  253.     kQ3NoticeInvalidAttenuationTypeUsingInternalDefaults = -28090,
  254.     kQ3NoticeBrightnessGreaterThanOne = -28089,
  255.     kQ3NoticeScaleContainsZeroEntries = -28088,
  256.     kQ3NoticeSystemAlreadyInitialized = -28087,
  257.     kQ3NoticeViewSyncCalledAgain = -28086,
  258.     kQ3NoticeFileCancelled        = -28085
  259. };
  260. typedef enum TQ3Notice TQ3Notice;
  261.  
  262. typedef CALLBACK_API_C( void , TQ3ErrorMethod )(TQ3Error firstError, TQ3Error lastError, long reference);
  263. typedef CALLBACK_API_C( void , TQ3WarningMethod )(TQ3Warning firstWarning, TQ3Warning lastWarning, long reference);
  264. typedef CALLBACK_API_C( void , TQ3NoticeMethod )(TQ3Notice firstNotice, TQ3Notice lastNotice, long reference);
  265. /******************************************************************************
  266.  **                                                                             **
  267.  **                                Error Routines                                 **
  268.  **                                                                             **
  269.  *****************************************************************************/
  270. EXTERN_API_C( TQ3Status )
  271. Q3Error_Register                (TQ3ErrorMethod         errorPost,
  272.                                  long                     reference);
  273.  
  274. EXTERN_API_C( TQ3Status )
  275. Q3Warning_Register                (TQ3WarningMethod         warningPost,
  276.                                  long                     reference);
  277.  
  278. EXTERN_API_C( TQ3Status )
  279. Q3Notice_Register                (TQ3NoticeMethod         noticePost,
  280.                                  long                     reference);
  281.  
  282. /*
  283.  *  Getting error codes -
  284.  *    Clears error type on next entry into system (except all of these 
  285.  *  error calls), and returns the last error, and optionally the 
  286.  *    first error. The parameter to these "_Get" calls may be NULL.
  287.  */
  288. EXTERN_API_C( TQ3Error )
  289. Q3Error_Get                        (TQ3Error *                firstError);
  290.  
  291. EXTERN_API_C( TQ3Boolean )
  292. Q3Error_IsFatalError            (TQ3Error                 error);
  293.  
  294. EXTERN_API_C( TQ3Warning )
  295. Q3Warning_Get                    (TQ3Warning *            firstWarning);
  296.  
  297. EXTERN_API_C( TQ3Notice )
  298. Q3Notice_Get                    (TQ3Notice *            firstNotice);
  299.  
  300. #if TARGET_OS_MAC
  301. EXTERN_API_C( OSErr )
  302. Q3MacintoshError_Get            (OSErr *                firstMacErr);
  303.  
  304. #endif  /* TARGET_OS_MAC */
  305.  
  306.  
  307.  
  308. #if PRAGMA_ENUM_ALWAYSINT
  309.     #pragma enumsalwaysint reset
  310. #elif PRAGMA_ENUM_OPTIONS
  311.     #pragma option enum=reset
  312. #elif defined(PRAGMA_ENUM_PACK__QD3DERRORS__)
  313.     #pragma options(pack_enums)
  314. #endif
  315.  
  316. #if PRAGMA_STRUCT_ALIGN
  317.     #pragma options align=reset
  318. #elif PRAGMA_STRUCT_PACKPUSH
  319.     #pragma pack(pop)
  320. #elif PRAGMA_STRUCT_PACK
  321.     #pragma pack()
  322. #endif
  323.  
  324. #ifdef PRAGMA_IMPORT_OFF
  325. #pragma import off
  326. #elif PRAGMA_IMPORT
  327. #pragma import reset
  328. #endif
  329.  
  330. #ifdef __cplusplus
  331. }
  332. #endif
  333.  
  334. #endif /* __QD3DERRORS__ */
  335.  
  336.